﻿<Window x:Class="SettingsWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="設定" Width="450" SizeToContent="Height" ShowInTaskbar="False" WindowStyle="SingleBorderWindow" ResizeMode="NoResize" WindowStartupLocation="Manual">
    <Grid>
        <DockPanel Margin="5">
            <Grid DockPanel.Dock="Bottom" HorizontalAlignment="Right">
                <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                    <Button Content="OK" Width="100" IsDefault="True" Click="OkButton_Click" />
                    <Button Content="キャンセル" Width="100" Margin="5 0 0 0" IsCancel="True" Click="Cansel_Click" />
                </StackPanel>
            </Grid>
            <StackPanel>
                <GroupBox Header="動画の表示方法" Margin="5">
                    <ComboBox x:Name="PlayKindComboBox" Width="200" HorizontalAlignment="Left"
                              DisplayMemberPath="Value" SelectedValuePath="Key">
                    </ComboBox>
                </GroupBox>
                
                <GroupBox Header="運営コメント" Margin="5">
                    <ItemsControl x:Name="CommentsItemsControl">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel />
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition Width="120" />
                                    </Grid.ColumnDefinitions>
                                    <Label Content="{Binding Path=Title}" Margin="0 5 0 0" VerticalAlignment="Bottom" />
                                    <TextBox Grid.Row="1" Margin="2"
                                             Text="{Binding Text}" ToolTip="{Binding Description}" VerticalAlignment="Top" />
                                    <TextBox Grid.Row="1" Grid.Column="1" Margin="2"
                                             Text="{Binding Mail}" VerticalAlignment="Top" />
                                </Grid>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </GroupBox>

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                        <ColumnDefinition Width="50" />
                    </Grid.ColumnDefinitions>
                    <Label Content="アンケート開始までの秒数" VerticalAlignment="Center" />
                    <Label Content="アンケート終了までの秒数" Grid.Row="1" VerticalAlignment="Center" />
                    
                    <Slider Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Maximum="300" Minimum="10" Margin="10 2 2 2" LargeChange="10" x:Name="SecondsBeforeStartSlider" />
                    <TextBlock Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right" Text="{Binding ElementName=SecondsBeforeStartSlider, Path=Value, StringFormat=0秒}" Margin="0 0 10 0" />

                    <Slider Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Maximum="300" Minimum="10" Margin="10 2 2 2" LargeChange="10" x:Name="SecondsBeforeEndSlider" />
                    <TextBlock Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Text="{Binding ElementName=SecondsBeforeEndSlider, Path=Value, StringFormat=0秒}" Margin="0 0 10 0" />

                </Grid>
            </StackPanel>
        </DockPanel>
    </Grid>
</Window>
